package com.yiduo.outpost.core.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yiduo.outpost.core.model.enums.Action;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.Instant;

/**
 * @Author yanwen
 * @create 2024/1/6 15:33
 */
@Data
@TableName("system_operation_log")
public class OperationLog {
    @TableId(type = IdType.AUTO)
    private Long id;
    @Schema(description = "功能模块")
    private String title;
    @Schema(description = "动作")
    private Action action;
    @Schema(description = "动作详细描述")
    private String description;
    @Schema(description = "请求地址")
    private String requestUri;
    @Schema(description = "请求来源")
    private String referrer;
    @Schema(description = "请求方式")
    private String requestMethod;
    @Schema(description = "请求参数")
    private String requestParams;
    @Schema(description = "请求头")
    private String requestHeaders;
    @Schema(description = "请求ip")
    private String requestIp;
    @Schema(description = "响应体")
    private String responseBody;
    @Schema(description = "异常内容")
    private String exception;
    @Schema(description = "操作人")
    private Long operatorUserId;
    @TableField(fill = FieldFill.INSERT)
    private Instant createdAt;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Instant updatedAt;

}
